﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace UPNP.IO
{
	public static class RootDeviceTypeIds
	{
		public const string InternetGatewayDeviceType = "urn:schemas-upnp-org:device:InternetGatewayDevice:1";
        public const string InternetGatewayDslDeviceType = "urn:dslforum-org:device:InternetGatewayDevice:1";
		//public const string WlanAccessPointType = "urn:schemas-upnp-org:device:WLANAccessPointDevice:1";

		public static IList<string> GetAllTypeIds()
		{
			var typeIds = typeof(RootDeviceTypeIds).GetFields(BindingFlags.Static | BindingFlags.Public);
			var ret = new List<string>();

			foreach (var typeId in typeIds)
			{
				// strings only
				if (typeId.FieldType != typeof(string))
					continue;

				// query full specification device DOM
				var typeIdValue = (string)typeId.GetValue(null);

				ret.Add(typeIdValue);
			}

			return ret.AsReadOnly();
		}
	}
}
